<!doctype html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
<base th:href="@{/}">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<!--style start-->
<th:block th:include ="commHeaderInclude::commHead"></th:block>
<th:block th:include="commHeaderInclude::formPageComm"></th:block>
<title>选择医保平台</title>
	<style>
		.clickToViewed{ font-weight: bold}
		.clickToViewed.viewed{ font-weight: normal}

        .payLogButton{}
        .bargainButton{}
        .verifyCancelButton{}

        .buttonContainer{
            width: 95px !important;
            float: left;
        }
		 .btn{
			margin-right: 5px;
		}
		.btn-sm{
			padding: 0.4rem;
		}
	</style>
</head>

<body class="ht">
	<th:block th:include="commHeaderInclude::loading"></th:block>
	<div class="tabTitle"><span><i class="mdi mdi-menu-up"></i>融资申请管理</span></div>
	<div class="content-wrapper">
		<div class="breadCrumb">
			<i class="mdi mdi-map-marker"></i>
			<span>医保贷业务系统<i class="mdi mdi-chevron-double-right"></i>融资申请管理</span>
		</div>
		<form class="searchForm" id="searchForm" method="post">
			<div class="card mb-3">
				<div class="card-body">
					<h4 class="card-title">按条件查询融资申请</h4>
					<div class="module searchModule" th:object="${vo.dto}">
						<ul class="mb-3">
							<!--
							<li style="width: 45%;"><label style="width: 6em;">医保平台名称</label><input type="text" th:value="*{dto.mipName}" name="mipName"/></li>
							<li style="width: 55%;"><label style="width: 6em;">医保统筹地区</label>
								<select name="province" id="province" class="form-control" style="width: auto;" >
									<option th:value="*{dto.province}">请选择</option>
								  </select>
								  <select name="city" id="city" class="form-control" style="width: auto;" >
									<option th:value="*{dto.city}">请选择</option>
								  </select>
							</li>
							-->
							<li><label>中征融资申请编号</label><input type="text" name="financeNo" th:value="*{@util.fStr(financeNo)}"/></li>
							<li><label>医保定点机构</label><input type="text" name="orgNameKeywords" th:value="*{@util.fStr(orgNameKeywords)}"/></li>
							<li>
								<label>申请时间</label>
								<div><input class="ht-dateInput" type="date" name="applyTimeStart" th:value="*{applyTimeStart}" data-options="endSelector:'[name=applyTimeEnd]'"/></div>
								<span class="ht_dateText d-inlineBlock">至</span>
								<div><input class="ht-dateInput" type="date" name="applyTimeEnd" th:value="*{applyTimeEnd}" data-options="startSelector:'[name=applyTimeStart]'"/></div>
							</li>
							<li><label>业务状态</label>
								<select name="financeStatus">
                                    <option th:value="*{financeStatus}" selected role="OptionSelected"></option>
									<option value="">全部</option>
									<option value="1">已申请</option>
									<option value="2">已成交</option>
									<option value="3">已终止</option>
								</select>
							</li>
							<li><label>授权状态</label>
								<select name="authStatus">
                                    <option th:value="*{authStatus}" selected role="OptionSelected"></option>
									<option value="">全部</option>
									<option value="1">有效</option>
									<option value="2,3">无效</option>
								</select>
							</li>
							<li><label>医保统筹区</label>
								<div role="SelectGroup" data-options="url:'/mcp/base/area/',defaultText:'全部'">
									<select name="province">
										<option th:value="*{province}" class="selected" selected></option>
									</select>
									<select name="city" style="width: auto">
										<option th:value="*{city}" class="selected" selected></option>
									</select>
									<select name="county" style="width: auto">
										<option th:value="*{county}" class="selected" selected></option>
									</select>
								</div>
							</li>
						</ul>
						<div class="searchBtnContainer">
							<input class="btn btn-primary" type="submit" id="search" value="查询">
							<input class="btn btn-clear" type="clear" role="ClearButton" value="清空">
						</div>
					</div>
				</div>
			</div>
		</form>
		<form class="listForm" id="listForm" method="post">
			<div class="card mb-3">
				<div class="card-body">
					<h4 class="card-title">融资申请列表</h4>
					<div class="module">
						<div class="hTableContainer">
							<table cellpadding="0" cellspacing="0" class="hTable" id="hTable">
								<thead>
									<tr>
										<th>序号</th>
										<th class="time">申请时间</th>
										<th>中征融资申请编号</th>
										<th>医保定点机构</th>
										<th>医保统筹区</th>
										<th>币种</th>
										<th>申请金额</th>
										<th>授权书编号</th>
										<th>授权状态</th>
										<th>业务状态</th>
										<th style="width: 285px;">操作</th>
										<th style="width: 70px;">备注</th>
									</tr>
								</thead>
								<tbody>
									<tr th:each="li,item:${vo.page.list}" th:class="${'financeViewStatus_'+li.financeViewStatus+' financeStatus_'+li.financeStatus}" th:data-id="${li.id}">
										<td th:text="${item.index+vo.page.startRow}">序号</td>
										<td th:text="*{#dates.format(li.applyTime,'yyyy-MM-dd')}" class="time">申请时间</td>
										<td class="financeNo"><a class="textLink-primary clickToViewed" role="openFrameWindow" th:classappend="${li.financeViewStatus=='2' ? 'viewed' : ''}" th:href="@{|/base/finance/detail?id=${li.id}&aid=${li.aid}|}" th:text="${@util.fStr(li.financeNo)}">中征融资申请编号</a></td>
										<td class="orgName"><a class="textLink-primary clickToViewed" role="openFrameWindow" th:classappend="${li.financeViewStatus=='2' ? 'viewed' : ''}"   th:href="@{|/base/hospital/detail4Finance?id=${li.id}&aid=${li.aid}|}" th:text="${@util.fStr(li.orgName)}">医保定点机构</a></td>
										<td th:text="${li.areaName}">医保统筹区</td>
										<td>人民币元</td>
										<td th:text="${#numbers.formatDecimal(li.financeAmount,1,'COMMA',2,'POINT')}">申请金额</td>
										<td><a class="textLink-primary" role="openFrameWindow" th:href="@{'base/auth/detail?id='+${li.authId}+'&aid='+${li.authAid}}" th:text="${li.authNo}" target="_blank">授权书编号</a></td>
										<td th:text="${application.DictMap.AuthStatus123[li.authStatus]}">授权状态</td>
										<td th:text="${li.financeStatusStr}" class="financeStatus">业务状态</td>
										<td>

											<div class="buttonContainer"><a class="btn btn-outline-primary btn-sm payLogButton" th:classappend="${li.financeViewStatus=='1' ? 'disabled' : ''}" th:if="${(li.financeStatus=='1' || li.financeStatus=='2') }" th:href="@{|/bank/payLog/create?financeId=${li.id}|}">查询医保信息</a></div>
											<div class="buttonContainer"><a class="btn btn-outline-primary btn-sm bargainButton" th:classappend="${li.financeViewStatus=='1' ? 'disabled' : ''}" th:if="${(li.financeStatus=='1' || li.financeStatus=='2') }" th:href="@{|/bank/bargain/create?financeId=${li.id}|}">录入放款信息</a></div>
											<div class="buttonContainer"><a class="btn btn-outline-primary btn-sm verifyCancelButton" role="openFrameWindow" th:if="${(li.financeStatus=='1' || li.financeStatus=='2') && li.revokeVerifyStatus=='1'}" th:href="@{|/bank/finance/verifyCancel?id=${li.id}|}">审批终止申请</a></div>

										</td>
										<td><a class="btn btn-outline-primary btn-sm" role="openFrameWindow" th:if="${li.revokeVerifyStatus!=null || li.financeStatus=='3'}" th:href="@{|/bank/finance/cancelDetail?id=${li.id}&aid=${li.aid}|}">终止详情</a></td>
									</tr>
								</tbody>
							</table>
							<div class="noneRecord" th:if="${vo.page.total==0}" style="min-width:1600px;">查无记录！</div>
						</div>

						<th:block th:include ="commHeaderInclude::pageInfoComm">
						</th:block>
					</div>
				</div>
			</div>
		</form>
	</div>
</body>
<script>
	var page=new ListPage();
	page.init();

	$(".financeNo a").on("click",event=>{
	    var tr=$(event.currentTarget).parent().parent();
	    $(".payLogButton",tr).removeClass("disabled");
        $(".bargainButton",tr).removeClass("disabled");
    })

    $(".payLogButton").on("click",event=>{
        var target=event.currentTarget;
        if($(target).hasClass("disabled")){
            alert("请点击“融资申请信息编号”查看申请详情，再查询/录入相关信息");
        }else{
            var url=target.href+"&from=finance";
            ht.openFrameWindow(url,"","large");
        }
        return false;
    })

    $(".bargainButton").on("click",event=>{
        var target=event.currentTarget;
        if($(target).hasClass("disabled")){
            alert("请点击“融资申请信息编号”查看申请详情，再查询/录入相关信息");
        }else{
            var url=target.href;
            ht.openFrameWindow(url,"","");
        }
        return false;
    })
    function setStatusNameById(id,statusName){
	    $(".hTable tbody tr").each(function(){
			var id2=$(this).attr("data-id");
			var id2=parseInt(id2);
			if(id==id2){
				$(".financeStatus",this).html(statusName)
			}
		})
	}
	//seajs.use("/mcp/hos/finance/js/ListPage.js");
</script>
</html>